package com.huike.clues.service.impl;

import com.github.pagehelper.PageHelper;
import com.huike.clues.domain.SysNotice;
import com.huike.clues.mapper.SysNoticeMapper;
import com.huike.clues.service.ISysNoticeService;
import com.huike.common.core.page.TableDataInfo;
import com.huike.common.result.PageResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Desciption SysNoticeServiceImpl
 * @Author LUXIN
 * @Date 2023-10-16
 */
@Service
public class SysNoticeServiceImpl implements ISysNoticeService {

    @Resource
    private SysNoticeMapper sysNoticeMapper;

    /**
     * 按照状态获取系统提醒分页列表
     *
     * @param status
     * @return
     */
    @Override
    public TableDataInfo<List<SysNotice>> page(String status) {
        // 调用业务
        TableDataInfo<List<SysNotice>> sysNoticeList = sysNoticeMapper.findNoticeListByStatus(status);

        return sysNoticeList;
    }

    /**
     * 获取提醒详细信息
     * @param noticeId
     * @return
     */
    @Override
    public SysNotice noticeDetails(Integer noticeId) {
        return sysNoticeMapper.findNoticeByNoticeId(noticeId);
    }

    /**
     * 提示未读变已读
     * @param noticeId
     */
    @Override
    public void updateStatus(Integer noticeId) {
        sysNoticeMapper.updateStatusById(noticeId);
    }

    /**
     * 获取系统提醒下拉列表
     * @param status
     */
    @Override
    public void pageByStatus(String status) {
        sysNoticeMapper.findNoticeListByStatus(status);
    }
}
